package mytest.wd4;

import com.alibaba.fastjson.JSONObject;

import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;

public class Test_1 {

    public static void main(String[] args) {
        String s = calculateAge("29-mno-1980");
        System.out.println(s);
    }

    public static String calculateAge(String birthday) {
        String[] birthdayArray = birthday.split("-");
        String year = birthdayArray[birthdayArray.length - 1];
        Integer currentYear = LocalDate.now().getYear();
        return String.valueOf(currentYear - Integer.parseInt(year));
    }
}
